package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entity.CommonResult;
import com.atguigu.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 孙志鹏
 * @createDate 2022/4/4 13:30
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE",path = "/payment")
public interface PaymentFeignService {

    /**
     * 根据Id进行获取Payment
     * @param id id
     * @return
     */
    @GetMapping("/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable(value = "id") Long id);

    /**
     * 超时测试
     * @return
     */
    @GetMapping(value = "/feign/timeout")
    public String paymentFeignTimeOut();
}
